package _11_整理题目._8_多线程;

/**
 *
 *
 */
public class _04_两个线程交替输出奇数和偶数 {
    public static void main(String[] args) {
        new Thread(new Thread1(), "one").start();
        new Thread(new Thread1(), "two").start();
    }

    static class Thread1 implements Runnable {
        private String name;
        @Override
        public void run() {
            for (int i = 0; i < 5; i++) {
                try {
                    Thread.sleep(2);
                } catch (Exception e) {
                    System.out.println(e);
                }
                System.out.println( + i);
            }
        }
    }
}
